<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    

    
<script>!function(){var e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,t=localStorage.getItem("use-color-scheme")||"auto";("dark"===t||e&&"light"!==t)&&document.documentElement.classList.toggle("dark",!0)}()</script>
    

<meta charset="utf-8" >

<title>用Hexo玩Github Page补遗</title>
<meta name="keywords" content="用Hexo玩Github Page补遗, 计算机, 移动互联网, 物联网, 互联网, 美食, 风景, 尤克里里">
<meta name="description" content="参考

常用命令
生成静态文件 hexo g
部署 hexo d
清除public 下所有静态文件(慎用) hexo clean
撰写文章 hexo new &quot;my article&quot;

部署以token 方式, Gith">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="用Hexo玩Github Page补遗">
<meta property="og:description" content="参考

常用命令
生成静态文件 hexo g
部署 hexo d
清除public 下所有静态文件(慎用) hexo clean
撰写文章 hexo new &quot;my article&quot;

部署以token 方式, Gith">

<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="/style/main.css">

  <meta name="generator" content="Hexo 6.3.0"></head>
  <body>
    <div id="app" class="main">

<div class="site-header-container">
  <div class="site-header">
    <div class="left">
      <a href="https://blog.mitoto.cn">
        <img class="avatar" src="/images/avatar.png" alt="logo" width="32px" height="32px">
      </a>
      <a href="https://blog.mitoto.cn">
        <h1 class="site-title">老曾的博客</h1>
      </a>
    </div>
    <div class="right">
        <i class="icon menu-switch icon-menu-outline" ></i>
    </div>
  </div>
</div>

<div class="menu-container" style="height: 0;opacity: 0;">
<nav class="menu-list">
  
    
      <a href="/" class="menu purple-link">
        首页
      </a>
    
  
    
      <a href="/tags" class="menu purple-link">
        标签
      </a>
    
  
    
      <a href="/archives" class="menu purple-link">
        归档
      </a>
    
  
    
      <a href="/about/me" class="menu purple-link">
        关于
      </a>
    
  
</nav>
</div>



  <div class="content-container">
    <div class="post-detail">
      
      <h2 class="post-title">用Hexo玩Github Page补遗</h2>
      <div class="post-info post-detail-info">
        <span><i class="icon icon-calendar-outline"></i> 2022-09-12</span>
        
          <span>
          <i class="icon icon-pricetags-outline"></i>
            
              <a href="/tags/web-%E6%95%99%E7%A8%8B/">
              web, 教程
                
              </a>
            
          </span>
        
      </div>
      <div class="post-content-wrapper">
        <div class="post-content">
          <h3 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h3><p><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/"></a></p>
<p><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/"></a></p>
<h3 id="常用命令"><a href="#常用命令" class="headerlink" title="常用命令"></a>常用命令</h3><ul>
<li>生成静态文件 <code>hexo g</code></li>
<li>部署 <code>hexo d</code></li>
<li>清除public 下所有静态文件(慎用) <code>hexo clean</code></li>
<li>撰写文章 <code>hexo new &quot;my article&quot;</code></li>
</ul>
<h3 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h3><p>以token 方式, Github 最近因为安全问题取消了账号密码方式认证，而采取token 方式认证。</p>
<p>config.yml 写法如下:</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span></span><br><span class="line">    <span class="attr">github:</span></span><br><span class="line">      <span class="attr">url:</span> <span class="string">&lt;repository</span> <span class="string">url&gt;</span></span><br><span class="line">      <span class="attr">branch:</span> [<span class="string">branch</span>]</span><br><span class="line">      <span class="attr">token:</span> <span class="string">&#x27;&#x27;</span></span><br><span class="line">  <span class="attr">message:</span> [<span class="string">message</span>]</span><br><span class="line">  <span class="attr">name:</span> [<span class="string">git</span> <span class="string">user</span>]</span><br><span class="line">  <span class="attr">email:</span> [<span class="string">git</span> <span class="string">email</span>]</span><br></pre></td></tr></table></figure>


        </div>
          
        <div class="top-div">
          <ol class="top-box"><li class="top-box-item top-box-level-3"><a class="top-box-link" href="#%E5%8F%82%E8%80%83"><span class="top-box-text">参考</span></a></li><li class="top-box-item top-box-level-3"><a class="top-box-link" href="#%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4"><span class="top-box-text">常用命令</span></a></li><li class="top-box-item top-box-level-3"><a class="top-box-link" href="#%E9%83%A8%E7%BD%B2"><span class="top-box-text">部署</span></a></li></ol>
        </div>
          
      </div>
    </div>

    
      <div class="next-post">
        <a class="purple-link" href="/2022/09/12/acee00091533/">
          <h3 class="post-title">
            下一篇：Django入门与实践
          </h3>
        </a>
      </div>
    
  </div>










<footer>
<div class="site-footer">
  <div class="social-container">
    
      
        <a aria-label="跳转至github" href="https://github.com/kzeng" target="_blank">
          <i class="icon icon-github"></i>
        </a>
      
    
      
    
      
    
      
    
      
    
  </div>
  
  
  
  
  
  
</div>
</footer>


      </div>
    </div>
    
<script id="hexo-configurations"> window.theme_config = {"image":{"lazyload_enable":true,"photo_zoom":"simple-lightbox"}}; window.is_post = true; </script>

<script src="/js/main.js"></script>






  </body>
</html>

